#include <stdio.h>
#include <memory.h>

int main( )
{
    int i, j, m;
    bool su[ 10000 ];
    memset( su, 1, sizeof( su ) );
    su[ 1 ] = false;
    for ( i = 2; i < 10000; i++ )
        if ( su[ i ] )
            for ( j = i * 2; j < 10000; j += i )
                su[ j ] = false;
    while ( scanf("%d", &m) != EOF )
    {
        for ( i = m / 2; i > 1; i-- )
            if ( su[ i ] && su[ m - i ] )
            {
                printf("%d %d\n", i, m - i);
                break;
            }
    }
    return 0;
}
